package com.example.tianyidemo.controller;
import com.example.tianyidemo.pojo.Housre;
import com.example.tianyidemo.pojo.Result;
import com.example.tianyidemo.service.HousreService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
//获取走马灯图片和链接
@Slf4j
@CrossOrigin//准许跨域请求
@RestController//包含@Controller（三层架构声明控制器）和@ResponseBody（转化json格式）
public class HousreController {
    @Autowired
    private HousreService housreService;
    @ResponseBody
    @GetMapping("/gethourseimg")
    public Result gethourseimg(){
        List<Housre> HousresList = housreService.gethourseimglist();
        return Result.success(HousresList);

    }
}
